<?php 
    include_custom("/views/header_mobile.php");
?>
<body> 

<div data-role="page">

	<div data-role="header">
		<h1>Phòng Trọ</h1>
	</div><!-- /header -->

	<div data-role="content">
        <ul data-role="listview" data-split-icon="gear" data-split-theme="d" class="ui-listview">	
		 <?php $count = count($rooms); $i=0;?>
            <?php foreach($rooms as $room): $i++;?>
            <li>
                <a href="index.php?rt=index/view&id=<?php echo $room->id;?>">
			
				<h3><?php echo $room->title; ?></h3>
				<p><?php echo $room->shortdescription; ?></p>
				</a><a href="index.php?rt=index/view&id=<?php echo $room->id;?>" data-transition="slideup">Chi tiết phòng trọ
			</a>
            <div  style="display: none;"class="block <?php if($i == 1) echo "first"; if($i == $count) echo "last"; ?>">
                <img src="skin/images/search-block-l_bg.png" width="3" height="180">
                <div class="sub-block block1">
                    <div class="right">
                        <div class="social">
                            <img src="skin/images/social3.png" width="27" height="24">
                            <span><?php echo $room->view; ?></span>
                            <img src="skin/images/social1_right.png" width="3" height="24">
                        </div><!--End .social-->
                       
                    </div><!-- end .right-->
                    
                    <div class="left">
                        
                        <div class="detail">
                            <label><?php echo $room->title;  ?></label>
                            <p class="link">
                                <img src="skin/images/link_icon.png" width="12" height="13"><a title="Ngày tạo"><?php echo date("d-m-yy h:i",strtotime($room->updated) ); ?></a>
                            </p>
                        </div><!-- end .detail-->
                    </div><!-- end .left-->
                    <div class="info">
						<p class="description">
							<?php echo $room->shortdescription; ?>
						</p>
						<div class="price">
							<ul>
								<li>Gía thấp nhất:<?php echo number_format($room->gia_phong_min, 2, '.', ',');?></li>
								<li>Gía cao nhất:<?php echo number_format($room->gia_phong_max, 2, '.', ',');?></li>
								<li>Số phòng còn trống: <?php echo $room->sophongcontrong;?></li>
							</ul>
						</div>
					</div><!-- end .info-->
                    <p class="button">
                        <a href="index.php?rt=index/view&id=<?php echo $room->id; ?>"><span class="free-api">Chi Tiết</span></a>
                        <a href="index.php?rt=index/view&id=<?php echo $room->id;?>&comment=true"><span class="rate-limited">Comment</span></a>
                        <a href="#"><span class="api-running">Báo thông tin sai</span></a>
                        <a href="#"><span class="relibility">Đánh giá</span></a>
                        <a href="#"><span class="relibility">So Sánh</span></a>
                    </p>
                </div><!-- end .sub-block block1-->
                <img src="skin/images/search-block-r_bg.png" width="3" height="180">
            </div><!-- end .block-->
            </li>
            <?php endforeach; ?>	
           </ul>	
	</div><!-- /content -->

</div><!-- /page -->

</body>
<?php 
    include_custom("/views/footer_mobile.php");
?>
